//
//  UIButton+extension.swift
//  YZXWeibo
//
//  Created by 叶周翔 on 16/7/24.
//  Copyright © 2016年 叶周翔. All rights reserved.
//

import UIKit
extension UIButton{
    
    convenience init(imageName:String, title:String,titleColor:UIColor = UIColor.darkGrayColor(), titleFont:CGFloat = 15, bkImageView: String = "timeline_card_bottom_background"){
        
        self.init()
        
        self.setImage(UIImage(named: imageName), forState: UIControlState.Normal)
        self.setTitle(title, forState: UIControlState.Normal)
        self.setTitleColor(titleColor, forState: UIControlState.Normal)
        self.titleLabel?.font = UIFont.systemFontOfSize(titleFont)
        self.setBackgroundImage(UIImage(named: bkImageView), forState: UIControlState.Normal)
        self.setBackgroundImage(UIImage(named: bkImageView+"_highlighted"), forState: UIControlState.Highlighted)
    }
}